<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>from_xml (Magnolia::Mark)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File magnolia.rb, line 454</span>
      <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">from_xml</span>(<span class="ruby-identifier">xml</span>)
        <span class="ruby-identifier">mark</span>             = <span class="ruby-constant">Mark</span>.<span class="ruby-identifier">new</span>()
        <span class="ruby-identifier">mark</span>.<span class="ruby-identifier">title</span>       = <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">'title'</span>].<span class="ruby-identifier">text</span>
        <span class="ruby-identifier">mark</span>.<span class="ruby-identifier">url</span>         = <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">'url'</span>].<span class="ruby-identifier">text</span>
        <span class="ruby-identifier">mark</span>.<span class="ruby-identifier">description</span> = <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">'description'</span>].<span class="ruby-identifier">text</span>
        <span class="ruby-identifier">mark</span>.<span class="ruby-identifier">screenshot</span>  = <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">'screenshot'</span>].<span class="ruby-identifier">text</span>
        <span class="ruby-identifier">mark</span>.<span class="ruby-identifier">id</span>          = <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">'id'</span>]
        <span class="ruby-identifier">mark</span>.<span class="ruby-identifier">rating</span>      = <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">'rating'</span>]
        <span class="ruby-identifier">mark</span>.<span class="ruby-identifier">private</span>     = <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">'private'</span>]
        <span class="ruby-identifier">mark</span>.<span class="ruby-identifier">created</span>     = <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">'created'</span>]
        <span class="ruby-identifier">mark</span>.<span class="ruby-identifier">updated</span>     = <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">'updated'</span>]
        <span class="ruby-identifier">mark</span>.<span class="ruby-identifier">owner</span>       = <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">'owner'</span>]
        <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">each</span>(<span class="ruby-identifier">xml</span>, <span class="ruby-value str">'tags/tag'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tag</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">mark</span>.<span class="ruby-identifier">tags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">tag</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">'name'</span>]
        <span class="ruby-keyword kw">end</span>
        <span class="ruby-identifier">mark</span>
      <span class="ruby-keyword kw">end</span></pre>
</body>
</html>